add John's code