Added code to recognize signatures (untested)