Fixed all the errors in perimeter_in_tign