Working for empty stack
Working patterns on all cases