I was hoping to get this merged sooner and worry about further optimizations later. Then we'd at least have correct code, even if it's slower.