Finally fixed randSum calculations. That was murder.
Still some error in the bottom loop of shuffle, but no idea where...