removes unused code, most button functions working