refactored to seperate formater code
generalizing formating, numbers don't matter