Removing extra variable and print statement