sort of got collision detection working. needs tweaks.