alex to write getValue function