missing some details in the isInside algorithm