implement collision function and step procedure