fyi, this code is all taken directly from the original coffee-script. I'm fine making the stylistic changes.