Implements max heap