Better comments.
Cleanup.
Faster version without lookup tables.