add profiling
provide the length of the map
change map write to read