Files broken into functions.. runs, but still needs tested.