add cpp file with indexing instead of mapping