added some p for auth and cleaned up comments