added todo, restructured main js