Fully implemented converted the source and header.

1. Untested, but at a glance should (!) work.