added case generating function