Add method classify and complete basic implementation.