complete Algorithm model