Added a preference class and some other stuff.