added malloc
removed old crap