added switch file to simplify if else file