added stuff for terminal and non terminal instances