added tests, fixed a bug and prepared for classification