ported our button logic to MVC