added solution of ex. 4 + refactoring.
some reorg, adding solutions for up to ex6.