more code cleanup
tested sim open and it works!!