Now remade with continious sampling.