Added the code as described