got collision detection working, but it kinda sucks so need a new algorithm