Changed to use the tolist method.