Changed malloc size to struct rather than pointer (n00b mistake)