added solution for ex6