Adding test and code for multiple arrays