Added push and pop feature for staack of open elements