Implementing functions.