added sanity check for argument
Merge branch 'master' of https://github.com/cs254project/lab6