Commiting the modified code.
Changed Code for implementation