Added simulation function
Minor updates