tests for case 1 and case 2