recursive search working but needs formatting