updated comments and format