optimized hw3