Fixed bugs! Calculation done