added some missing comments and cleanup