return array instead of printing