final updates with commenting, all tests passing