changed string to int to C version