changed note calculation algorithm