Code Modification

Modified specified code with solution.