changed comparing from previous to siblings