updated optimized