minimising average cost!
Running downsampled version
fixed also for minimisation