Some errors, but a lot faster now I'm using a lookup table.