Final solution for week-6