added cases functions, all still untested