Finished first version of hierarchical classifier