optimized solve8