update write function to be more generic, dynamic and cooler
add a method to determine the number of digits a filesize has and method to align string.format left or right
change code to use new write methods