stripped comments and unused code
begin mods to not use matfiles files