Removed free(temp)