corrected parsing, added threshold default
reformatted argument checking