replaced list with arrays an ienumerables for simplicity