justinfan: Added mode parsing