works again - needs refactoring - but works...