implement leave functionality.  more thorough testing to come