class-based implementation of the LinkedLIst assignment