Optimized a bit, not still there yet though.