modified for more data types