beginning calculations