By Cooper

I had to rewrite significant portions of the code.