Sorted patients in doctor list, improved and refactored code.