first %d implementation