Newer version of the reference script