Updated to handle cell arrays vs num arrays