added fns to get data up to a timestamp