first version fetching and counting  data