added quantazing scheme as in original paper