aded userPrefs.js and modified code to use it