Addressed all comments mentioned by Randy.

I have also gone through all test cases to check comments and variable names.