some logic fixes plus a CSS fix