initial stargate code