debugging petra loops