finish off all functions