Changed results array to vector to avoid segfaults.