parameter optimisation works

it's slow, but it does check 10*4*10*9*3*3 (32400) parameter
configurations at the moment, obviously we can make that smaller...