add the optimized version