Modified code for readability