Converted heap implementation to purely array based implementation.