optimization and add cap