finished a few function