working on max heap