Added getPercentage function, documentation added