added/updated test flag and array building