rewritten to coffee script