assign_pos for CArray

not entirely sure if this is the correct way to do it (whether or not to have the deconts and unboxes where i put them), and didn't actually test it. looking for feedback first.