making class function take param self