added some final comments, catching some input errors next
error checking is now complete