return array of results in the right order