Add function for retrieving a leaf node by position