added last-of-type alternative