collision check using lengths