improved usage of coffeescript for loops