refactor list, add stack