updated code to use xml layout file