Now uses MATLABs built-in NM fminsearch
general attempts at speedup