expr calculation function
unit tests for calculate function