added base class for algorithms and implemented shortenings recognition