Update logic.js

added dynamic routing + some styling