Add Test cases.
All test case passed
Optimized loval var.