implements save/load codes.
implement resetMap and change the api to use position array.