Continued with compareData function