debug and improve