added simulation and optimizer functions