add extramath & more type inference