tested all cases