more changes to use arrays