works but without generalization of data type