Initial revision, copied from Reservations project