fixed small bug in heap.cpp