made changes necessary to create module heap.pm from heap.pl