improved collinear lines check
return if invalid file