fixed a bug added calculus