Using maths to reduce wait times at the doctor