Added implementation of basic functions.