optimized omni code quite a bit