working on stand alone c sim