adding cross references data, and fixing lots of bugs