isBodiesCollide function added