adding code for setting user preferences on horz/vert layout