fix code style, update comments