First attempt to layout and some logic