use sprintf instead of cat