updated cosim example, seem to work better now