added limit options. trap INT. file ending