added switch for local/global scope of data
updated readme for new scoping as well