lots of notation and cleaning up of code