more memory stuffs, not quite working yet though
malloc'd a bit more, more bugs received