got basic collision detection working with closed functions