Made this code more readable