Added map and test functions.