find correct body nodes
push node ends to 'end' keywords