finished function refs. going to commit in case anything terrible happens when I run it.