removed some test code and fixed wrong direction of id map