Tried to reduce use of realToFrac, the main bottleneck