updated the code to allow for larger integers