Final version. Unit testing completed.