Updated final grade calculation algorithm.