Implementing a class (still learning)