Implemented define exp and added new test cases.