cleaning up code and working on writeup