data saving method changed.
using map instead of a big array