Added creation of preferences funct