Added memory allocation (vic_alloc) and cleanup (vic_finalize)