replaced the code to check for complete cases by calling function complete.cases()