optimization and comments changes