unexpectedtoken:

  1. follow the instructions. make sure it works the way the author intended first. arrive at a working state. this is usually not trivial.
  2. study its structure. change something small that is a step towards making the thing you are after.
  3. test to see if it still works.
  4. if it does, keep your change. if it does not, undo it to return to a working state.
  5. repeat from step 2 until you either give up or arrive at the thing you were after.