completed solution-1