Removed query and used the available array for assignments.