add solution for assignment 2.4