works for matlab