secondary strusture plotting and legend, several bugfixes