using session for term, adding test for difference calculation