Final commit, with tested code and example.