assignment 2. clean up with comments