implements the preferences window