fixed bug with malloc instead of just creating the pointer on line 29