Completed solution for week-4