transfered resampeling to own classes