Added handling of exponents

I'm sure it's sloppy but it works. My first python :D