added graphs and corrected simulation