cleaned up the comments
added comments, fixed some style points and made file specification more consistent
fixed references to the record object to be properties not indexes
added comments and fixed minor styling