improved fileio interface
Filled in mg file input, with example problem