fixed stopping simulation...maybe finally working version...needs to be tested more