percantage function is upgraded