Added implementations of functions.