Dear annalex, any works that one does with the motivation of acheiving salvation are as filthy rags, and cannot benefit your state.
Only the works of one that is saved can be good.
"Filthy rags" is from a different context, but that is correct what you intend to say: good works are not done for any other reason than love of God and one's neighbor.
Only the works of one that is saved can be good
Based on what scripture?
one thing is wanting to thee: sell all whatever thou hast, and give to the poor, and thou shalt have treasure in heaven: and come, follow me (Luke 18:22)
Observe: the young man was not saved, but that what he did is good. It just was not enough. The same episode promises salvation to anyone who "hath left house, or parents, or brethren, or wife, or children, for the kingdom of God's sake". So these things are good even before the doers of these things are saved.