makes sense to rename $x to $data