many many bug fixes and layout changes