converted the JS to coffee for the rating functionality