increase the speeds on gradient computation