Improved code readability and fixed a commit from geetanjali