Working version of Hart85 algorithm