adding new classes

and separating the button functions