Convert js to coffeescript. fix #2