renamed foreach start and end variables
some helper functions
fix: list element distribution
include spaces in captured code
gen_for helper function
fix code capture regexp