implemented basic layout and logic