Changed to use explicit lists to make traversal easier.