Working out some bugs using one shot.

The basic example doesn't quite work but this is a large improvement
over previous code. User jr4284 pointed out some really novice bugs.
Thanks jr2482!