all of the patient controller has been gone over briefly and some minor refactoring has been done