added preference class and layout file