Comments and some more error checking