add some code lines from christoph