Fixed code to be more readable