Changed reward function, added a read and write to store and read results of PBVI if needed.