use nalloc, where it is possible