Rewrote main class with written modules.