Moved a bunch of code around to make it cleaner and added the initial outline code