fully functional mp to/from file