updating basic reference linking to work with many reference levels