fixed coffeescript and improved initializatoin