remove unecessary calloc and add assertions