fixing stithcing substr bug
fixing thresholds to fix alignment problems with new reference