implemented main part of #189

ToDo: some minor bugfixing
Merge remote-tracking branch 'origin/ribbons' into ribbons