Got reservations algorithm working