Shortened and optimised the printNumber-function