Code Updated

The code was updated with request in the code review.
Code coverage was added as well.