Refactored the function so that we only loop after we have decided if we have any arguments