use std::string for interleaving
add total to memory tracking