fixed remove implementation for heap