clean up the code a bit before submitting progress report 2