adding arg and data validation checks
+private helper fn to count ones in array