add solution for ex3
finished ex4