Logic for compare and swap for multiput should be close to correct