updated isntability studying code