using some coffeescript shorthands for a) iterators and b) check of array emptyness
rebuild and docs