fix bugs and tweak styles