Made a few changes to be compatible with secret bay.