changed self collision detecting