Added a dataReady() function