Completed the mapping functions