Created decimation function