add a ref to the paper I stole this from