changed blocks vector to be on the heap