add enumerate method, and test it.