Optimized a bit, not still there yet though.
Reduced comparison count.