Convert loop.js to coffee