Added percent option to stats function