First working Version of Problem5