| | Re: question regarding comma
In the first sentence, the non-finite clause is additional information - a sort of afterthought. the comma reflects the dramatic pause that would probably occur in speech between the two thought groups.
In the second sentence the non-finite clause is an integral part of what the speaker wants to say. There is a single thought group, and there would be no pause. And so there's no comma.