better memory managment + additional iteration (needed?)