add john's code
Merge pull request #1 from pemulis/master

add john's code