cheap n*n collision detection/resolver