made first mapping algorithm
fix merge conflict with test and test.cpp