moved some mallocs.