using strcmp instead of checkEmpty