check opposite direction of lines too