redesigned main to use functionality from optimizer and added external model file