removed file i/o from main file