trying to speed up a gnarly script with lots of non-linear constraints - any ideas?