correct version of the code