hopefully correct simulation by jmichaels | SimScale...