Start of iteration logic