test calculate function