enhance the algo of collision