Setting up some functions.