removed whitespace after func, added user prefs