Modify these two solutions about calling any math apis