add printArray function
validate command line params
rename checkParams to inArray
fix indentation