I put mallocs in and the stat function but I am afriad it might be useless