Speed improvements

Various changes made for increased speed:

-Added  onton() to calculate (-1)^n as an integer

-Converted various sub calculations from double to integer to increase speed