Updated Ex3, Problem 1
Corrected Ex3, Problem 1 and extended it with a stop condition.