Various algorithms by self constructed.