Made the program more modular.