Fixed problem by adding iterator, developed further problems