added array stuff and got it working