move life code to external js, buttons, logic