Updated the code for readability