add cory foy's full solution

I want to contribute this project