Answers to coding test

I tried to add comments where each question corresponds to code changes,
but it wasn't easy if I changed/added multiple things.