attempting array switch with foreach