Added line checking for collisions