updated style and modify code