Trying to end function