created function 6 for number library, passing to main code