some collion detection work