Added code to solve problem