Sim Fix and Code cleaned