Lost these changes when using Pete's code