added caching to the aligner; updated test to test the caching against the current regular method