register mapping finished

next is need to restructure the code