needed to append self. to some variables in functions