Added min and max functions need to implement functionality