Added init method that takes an array of buttons.