Problem 6 and adding ttmath for big int support later