use array instead of ArrayList