Wrote some functions.