Adding bounds determination

Adding bounds determination for box movement and resizing.