functions for online/offline data epoching