 		}
 
 	}else if(stencil_width == 2){
-		typedef thrust::tuple<thrust::detail::normal_iterator<thrust::device_ptr<int16_t> >,gdf_valid_iterator> zipped_stencil_tuple;
+		typedef thrust::tuple<thrust::detail::normal_iterator<thrust::device_ptr<int16_t> >,gdf_valid_iterator, bit_position_iterator > zipped_stencil_tuple;
 		typedef thrust::zip_iterator<zipped_stencil_tuple> zipped_stencil_iterator;
 
-		zipped_stencil_iterator zipped_stencil_iter(thrust::make_tuple(thrust::detail::make_normal_iterator(thrust::device_pointer_cast((int16_t * )stencil->data)),valid_iterator));
+
+		zipped_stencil_iterator zipped_stencil_iter(
+				thrust::make_tuple(
+						thrust::detail::make_normal_iterator(thrust::device_pointer_cast((int16_t * )stencil->data)),
+						valid_iterator,
+						thrust::make_transform_iterator<modulus_bit_width, thrust::counting_iterator<gdf_size_type> >(
+								thrust::make_counting_iterator<gdf_size_type>(0),
+								modulus_bit_width())
+				));
 
 		if(width == 1){
 			thrust::detail::normal_iterator<thrust::device_ptr<int8_t> > input_start =

			output->size = output_end - output_start;
		}
	}else if(stencil_width == 4){
		typedef thrust::tuple<thrust::detail::normal_iterator<thrust::device_ptr<int32_t> >,gdf_valid_iterator> zipped_stencil_tuple;
		typedef thrust::zip_iterator<zipped_stencil_tuple> zipped_stencil_iterator;

		zipped_stencil_iterator zipped_stencil_iter(thrust::make_tuple(thrust::detail::make_normal_iterator(thrust::device_pointer_cast((int32_t * )stencil->data)),valid_iterator));

		if(width == 1){
			thrust::detail::normal_iterator<thrust::device_ptr<int8_t> > input_start =

		then i will make it so that i zip a counting iterator as well and use that counting iterator to figure out which bit to and
		i think something like a repeat iterator or somethign else will suffce

 */

std::map<gdf_dtype, int16_t> column_type_width = {{GDF_INT8, sizeof(int8_t)}, {GDF_INT16, sizeof(int16_t)},{GDF_INT32, sizeof(int32_t)}, {GDF_INT64, sizeof(int64_t)},
		{GDF_FLOAT32, sizeof(float)}, {GDF_FLOAT64, sizeof(double)} };
