modified reflect_ball function