add solution for ex 3