Layout beta

Fixed some bugs and started working on the layout.