added toMap method