updated all $a to $data. minor testing