Added safari support
collision detection added