implementation for insert, peak and sift_up