My modified version of the code