add macs simulation code