fixed bug in oversampling
clearer implementation of the oversampling process