modified collision detection and added box length form to html