finish some functions