removido coisa desnecessaria
added points to check intersections
add checks for intersections