merge in lookup table algorithm

merged in lookup table algorithm (quadratic) - builds, not tested.
updated some comments.