removed some unneeded variables and added some fields to prefs