finish part of the fist function