Add percent function from stackoverflow