added collision testing loop
misc refactor