taking James's changes to sgl simulation