Updated to use an if statement for more clarity