Correct code as recommended by nickdesaulniers