FIXME resolved: replaced dynamic memory allocations with std::vector.