added save file functionality and word wrap to legend tables