I don't know javascript scopes well enough at all. I'm playing around with them here