formatted the code for readability