added buttons and some controller code