implement resource map and passed all testcase