Defining a method the right way