the output is correct for the code you gave.