Finish implementation of the basic functions.