Got rid of mallocs