Tidy up the percentage calculation