added broken-out function style, and a commented more node-ish style