factored out some unnessary memory allocations
fixed corruption issue - missing -1 in int_binary_search