barebones maxheap implementation in C