use vars, not window.  All hail @NachoSoto