functional decomposition and for loops 2313528