add math and fsm to mylib