Some changes in simulator and added tick event to simulator usw.