Added a lot of classification code