slightly modified to return data value