working on terminal expression finding