added functions to handle large numbers