adding self parameters to class functions