started debuging. left todo: lower-level array cpy