changed carpic prototype to a function still not quite working