Finished code to create input array