heap insertion now works correctly