adding an improved update method
Merge branch 'master' of https://github.com/fryingpan/Assignment2