Bug fixes and code tidy up
Added a new layout