add or/and logic back, prettify output