fixed bug about shifting values.