Re-formatted the code for readability