toggle, get and set refactored into separate functions flag vars moved from global scope -i flag added to README