clean up code, ready to submit