collision logic working better
improved collision logic