renamed next to linkedNode to avoid confusion with the Iterator implementation