Added handling for upper and lower bounds