Optimized and correctly tested