addded free and copy funcs for heap