drop malloc. use calloc everywhere.