Algorithm implementations, custom memLen.