converted onehot to a class
added  backward compability to onehot