Completely reimplemented itentification. Might still be buggy.