cleaned out some fat (unused variables) from the original tutorial and added clarifying comments