updated code for readability.