changing argument processing and adding debug