collide func
refactor whole thing and use collision