the final version of the code