Foreach and if/else working, commented.