first draft of calculation