For is defined in term of two functions.
File restructuring
Total implementation using sum and map