remove updateStack function (useless) and improve syntax