V3.1 added comments and minor housekeeping

-Did get rid of a warning in measure functions replacing -1 to uint_max