Added Ex-3 solution (not completed last subtask)