added check for new algo
added modifications for new algorithm