Updated the classification code. To be tested.