Working on final function.