updated reservation code and added functions for reservation