Added metropolis optimizer