Added iterator and replaced vectors with lists