fixed minor errors in logic.js