changed return type of get_cow_mask