malloc restructure