original unported algorithms from v. 0.2.7