converting js to coffe. cleaning up stuff