Added method to get ancestors in reverse order