remove all mallocing code