adding functionality prior to algorithm