There are lots of bugs in the sample code and tutorial, could you update them and specify in details for beginners?