changed malloc to alloca on the data struct

so that the data struct is allocated on the stack