updated layout code