fixed detector segment bug where if a path ends on the segment and the next path moves back in the opposite direction it wouldn't detect the second path
changed the order of arguments in some region methods to match the documentaiton