Understand all of code now and how memory layout works. I will have to pull it apart in order to replace raw memory handling with vectors!