changed to returning an associative array