finished recursive search, machine search and print stuff