Basic functionality there. Needs refactoring