Added routines to get data from device