Solution for assignment