Added comments for each part, added Writes to output for each part