using sprintf() instead of a very long series of concatenations
eliminating unnecessary assignments, making the code compact