changes to code and writeup