Adjusted model structure. Added R functionality for reading model data.