Added simulation test and test with database model.