Testing W algorithm