comments and fix maintenance of heap