finished moving functions to class