improved classification

solved the earlier issues and bugs