Added actorbintree code and fixed some small bug in simulation