Fixed a bug in My implementation of stacking - incorrectly randomizing instances