added self to functions