fix bugs and improve aesthetics