Hacking on a heap implmentation