using .uniq on hashes for selections, not sure if necessary
updated while loop for overwriting moves