Good Works That Will Not Be In Vain

Is it true that regardless of one’s religion or beliefs, a person will be saved if good qualities are found in him?