first step to loop parsing