translated js to coffee