Implementation of Exercise 3 - also removed java dependencies from Main