update add 0 and 1 when n is 0 and 1