added sampleBy, window, previous