updated logic.js, few useful comments