half working version of createReference