Defining methods using the class prototype