use array instead of double links