Base code done, with caveats. Needs to be restructured to work with 'gui' code