updated comments and changes some variable names
Added in error handling and finished verify_array