modify if pyramid to if forest