setting up to end function wip