cleanup of matlab functions