finish basic function.