now with no global vars