fixed bugs and improved classifier