added methods for downsampling more than one level