added output mode switching (front/top/both)