added some more functionality to parsing arguments