Finished newbutton functionality