Fixed insert function

Insert function now compares element to be inserted and places element
in location. Needs to be tested