finish some basic functions