add case assignment functions and tests