hopefully finished up cross-referencing plus added comments