functions written

functions have been completed