fixed iteration and layout problems.