added rudimentary colision detection