add some notes and error checking