updated layout and functions