somes changes to loops parsing