Add communication between simulator and main