Rewrite heap.h; implement gscc and gsp;