rewrote the way references work