added tests and newAppointment