merged latest code from Ingmar Schneider (modifications left out in last commit).