order timewise correctly for appointments