start to make reference() array-friendly
Merge pull request #23 from yetanotherhacker/refary1

start to make reference() array-friendly