add to calculate corner number function