Function for parsing arguments