add toMap function
in 8/27