support arrays and consolidate into one fn - closes #2