Fixed the stem_length function