Updated calculation to include inside points
Updated first inside segment