copying over from the collatz repo, see there for deets