add stack functionality