stage 1

finished the calculate function and wait for testing