modify layout, code style and some small mistakes