Writing and testing the binary searching functions.