Added function to generate arrays based on user provided parameters