Revised and updated all massi functions. Significant changes have been made to data input and output formats