This version has the citations on where I got some of my code from