Finished tutorial part 2.

added validation and comments