reroganized mappig and function file