Added second part of the code