start work on terminal logic