code clean and output fix