Defining a method on the scope