converted js to coffee