using in_array instead of checkIfResultAlreadyThere()