Restructuring most of the program, not functional yet.