enabled collision() method to take flag inside an object argument