changes from gra13f. Sim working