fixed bug in sum-gen, added my-map
add foreach implementations