modified create_court_mask