Add target id translation code and write pseudo code for building RG and PG translation tables