recognizing loops elses and ifs