fixed collision detection by correcting bug in line intersection code
removed some buggy collision detection code