modifed to work with sys arv instead of raw_input