Changed to double, using math library pow function

Everything here seems to be working, some extensive testing to make sure everything works will still be necessary.

Commenting will get done tomorrow