initialize arrays correctly