Added solution for forth problem