Hi Ferdinando and Jim, Thanks for your help! The threshold 'trick' is very easy to implement within the current framework. I cannot use it for leaving boundary pairs out though. Therefore I am interested in knowing from you, Ferdinando, which optimizer you would suggest using instead of Levenberg-Marquardt. Best regards, Sam Theisens