moved printing functionality into search_wrapper
added text files for checks, added an array to store structs and then freed them
eliminated memory leaks and freed some reachable memory
changed result from pointer to int, in search_wrapper
no leak are possible