added some simulation functions