mainly improved (now I understand it) Boyer Moore algorithm implementation