added better argument checking closes #2