Doesn't work...switching branch to use globals