This compiles but has not been tested, checkheap needs to be updated to be more thourough to help with debugging