calculate percentage correctly