changed Preference data structure

fixed their respective functions