changed map.cpp to map.cc and added more debugging to help identify the bidirectional problem.