Reworked ai value reading.