start ex 4
Implemented as much as I understood what is the goal of ex 4. Some more work is to be done.