modified sprintf