optimization and comments