Wrote basic functions.