attempt 2 by Thijn | SimScale