Beginning heap code