Rewrite the mapping procedure
Add documentation