added elastic collisions