added socket init code to logic.js. verified swapping and discard use cases
fixed merge conflict