Updated "for" functionality.

Added an caching to the "len" of every for.