added notes and removed extraneous code