map switch function added, but not complete