Finished initial implementation.

Needs more testing before submittal.