Movement calculations

Made all objects bind themselves inside the box for movement.