added functions to simplify element loop. (WIP)
refactored list with id <--> id_parent fields instead of positional params