let length = match cp_dimensions#get with | length :: _ -> length | [] -> failwith "Dimensions list is empty."