lots of changes to get cell based variables and the special case of
 xyPosition to work properly.