Problem 3 solved.
Finally a class.