finished all buttons and almost all the logic