logic returned to code