Having trouble implementing the classes