add tests
add reverse search and improve CLI output