legend, layout, some fix