copy from collaboration with Stephan. so I can carry on practicing on my own