Solution fourth assignment