added main file; converting to modular design