Started work on f2. Refactoring code to a more modular approach whilst doing so.