replaced sprintf